class Solution {
public:
    typedef struct ListNode Node;
    ListNode* middleNode(ListNode* head) {
        Node* fast = head;
        Node* slow = head;
        while (fast && fast->next)
        {
            fast = fast->next->next;
            slow = slow->next;
        }
        return slow;
    }
};